package me.yuxiaoyao.jpa.nativesql.mapper;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author kerryzhang on 2020/12/16
 */


public interface SqlDateConverter {
    /**
     * java.sql.Date to java.time.LocalDate
     *
     * @param date
     * @return
     * @author kerryzhang on 2020/12/15
     */
    LocalDate sqlDateToLocalDate(java.sql.Date date);

    /**
     * java.sql.Date to java.util.Date
     *
     * @param date
     * @return
     * @author kerryzhang on 2020/12/15
     */
    java.util.Date sqlDateToDate(java.sql.Date date);

    /**
     * java.sql.Timestamp to java.util.Date
     *
     * @param timestamp
     * @return
     * @author kerryzhang on 2020/12/15
     */
    java.util.Date sqlTimestampToDate(java.sql.Timestamp timestamp);

    /**
     * java.sql.Timestamp to java.time.LocalDateTime
     *
     * @param timestamp
     * @return
     * @author kerryzhang on 2020/12/15
     */
    LocalDateTime sqlTimestampToLocalDateTime(java.sql.Timestamp timestamp);

}
